package com.ruoyi.web.wuliu.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.web.wuliu.mapper.TSpecialLineMapper;
import com.ruoyi.web.wuliu.domain.TSpecialLine;
import com.ruoyi.web.wuliu.service.ITSpecialLineService;

/**
 * 专线Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-12-20
 */
@Service
public class TSpecialLineServiceImpl implements ITSpecialLineService 
{
    @Autowired
    private TSpecialLineMapper tSpecialLineMapper;

    /**
     * 查询专线
     * 
     * @param id 专线主键
     * @return 专线
     */
    @Override
    public TSpecialLine selectTSpecialLineById(Integer id)
    {
        TSpecialLine tSpecialLine = tSpecialLineMapper.selectTSpecialLineById(id);
        tSpecialLine.setBrowseCount(tSpecialLine.getBrowseCount()+1);
        tSpecialLineMapper.updateTSpecialLine(tSpecialLine);
        return tSpecialLine;
    }

    /**
     * 查询专线列表
     * 
     * @param tSpecialLine 专线
     * @return 专线
     */
    @Override
    public List<TSpecialLine> selectTSpecialLineList(TSpecialLine tSpecialLine)
    {
        return tSpecialLineMapper.selectTSpecialLineList(tSpecialLine);
    }

    /**
     * 新增专线
     * 
     * @param tSpecialLine 专线
     * @return 结果
     */
    @Override
    public int insertTSpecialLine(TSpecialLine tSpecialLine)
    {
        tSpecialLine.setCreateTime(DateUtils.getNowDate());
        return tSpecialLineMapper.insertTSpecialLine(tSpecialLine);
    }

    /**
     * 修改专线
     * 
     * @param tSpecialLine 专线
     * @return 结果
     */
    @Override
    public int updateTSpecialLine(TSpecialLine tSpecialLine)
    {
        return tSpecialLineMapper.updateTSpecialLine(tSpecialLine);
    }

    /**
     * 批量删除专线
     * 
     * @param ids 需要删除的专线主键
     * @return 结果
     */
    @Override
    public int deleteTSpecialLineByIds(Integer[] ids)
    {
        return tSpecialLineMapper.deleteTSpecialLineByIds(ids);
    }

    /**
     * 删除专线信息
     * 
     * @param id 专线主键
     * @return 结果
     */
    @Override
    public int deleteTSpecialLineById(Integer id)
    {
        return tSpecialLineMapper.deleteTSpecialLineById(id);
    }
}
